# -*- coding: utf-8 -*-

import json

import requests

_SEND_TEXT_API_TELE = "https://api.telegram.org/bot907516707:AAFqWRwdD0Gi5dOfvDqLsFrZil7DHmcBznA/sendMessage"


def send_text_msg_tele(chat_id, chat_text):
    chat_text = chat_text.replace("[", "-").replace("]", "-").replace("_", "-")
    headers = {"Content-type": "application/json", "Accept": "text/plain"}
    post_data = {"chat_id": chat_id, "text": chat_text, "parse_mode": "Markdown"}
    j = json.dumps(post_data, separators=(",", ":"))
    requests.post(_SEND_TEXT_API_TELE, data=j, headers=headers, timeout=5)
